<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
</head>

<body>
    <header class="aui-bar aui-bar-nav" style="background-color: #03a9f4;position:fixed;" id="header">
        <a class="aui-pull-left aui-btn" tapmode onclick="closeWin();">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title" id="title">
            检测单处理
        </div>
    </header>

    <div id="tbodyHtml">

    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../script/public.js"></script>
<script type="text/javascript">
    apiready = function () {
        doSearchTeamGid()
    }
    //跳转页面
    function goPage(chkBillType, title) {

        var name = "";
        if (chkBillType == "1") {
            name = "qcmChkBillCl";
        } else if (chkBillType == "2") {
            name = "qcmChkBillCp";
        } else if (chkBillType == "3") {
            name = "qcmChkBill5s";
        } else if (chkBillType == "4") {
            name = "qcmChkBill5s";
        } else if (chkBillType == "5") {
            name = "qcmChkBillEm";
        } else if (chkBillType == "6") {
            //name = "qcmChkBillCl_ll"
            name = "qcmSelectChkBill_ll"
        }
        api.openWin({
            name: name,
            url: name + '.html',
            pageParam: {
                name: "qcmChkBill",
                chkBillType: chkBillType,
                title: title,
            }
        });
    }
    //菜单下拉框
    function doSearchTeamGid() {
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/getUtilComboxList";
        var data = {
            values: { ////以表单方式提交参数（JSON对象）
                tablename: "md_paraconfig",
                column_name: "paracode",
                column_value: "paraval",
                condition: " paracls = 'chkBillType' ",
                appVersion: api.appVersion,
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 30,
            returnAll: false,
            async: false,
            data: data
        }, function (ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var map = eval("(" + data + ")");
                if (map.code == "0") {

                    var list = eval(map.list);
                var html = "";
                //新增来料检测单页面
                
                for (var i = 1; i < list.length; i++) {
                    if (i == 1) {
                        html += "<div class='aui-btn aui-btn-info aui-btn-block' style='margin-top:100px;' onclick=\"goPage('" + '6' + "','" + '来料检测单' + "')\">" + '来料检测单' + "</div>"
                        html += "<div class='aui-btn aui-btn-info aui-btn-block' style='margin-top:5%;' onclick=\"goPage('" + list[i].value + "','" + list[i].label + "')\">" + list[i].label + "</div>";
                    } else {
                        html += "<div class='aui-btn aui-btn-info aui-btn-block' style='margin-top:5%;' onclick=\"goPage('" + list[i].value + "','" + list[i].label + "')\">" + list[i].label + "</div>";

                    }
                }
                
                $api.html($api.byId("tbodyHtml"), html);
                    //失败
                } else if (map.code == "1") {
                    api.toast({
                        msg: map.message,
                        duration: 3000
                    });
                }

                // var list = eval(map.list);
                // var html = "";
                // for (var i = 1; i < list.length; i++) {
                //     if (i == 1) {
                //         html += "<div class='aui-btn aui-btn-info aui-btn-block' style='margin-top:100px;' onclick=\"goPage('" + list[i].value + "','" + list[i].label + "')\">" + list[i].label + "</div>";
                //     } else {
                //         html += "<div class='aui-btn aui-btn-info aui-btn-block' style='margin-top:5%;' onclick=\"goPage('" + list[i].value + "','" + list[i].label + "')\">" + list[i].label + "</div>";

                //     }
                // }
                // //新增来料检测单页面
                // html += "<div class='aui-btn aui-btn-info aui-btn-block' style='margin-top:5%;' onclick=\"goPage('" + '6' + "','" + '来料检测单' + "')\">" + '来料检测单' + "</div>"
                // $api.html($api.byId("tbodyHtml"), html);
            }

        });
    }
    //返回按钮
    function closeWin() {
        api.closeWin({});
    }
</script>

</html>